Skip to content

Prevent Helium complex multiplication saturation - #340

Open
sylvesterkaczmarek wants to merge 1 commit into
ARM-software:mainfrom
sylvesterkaczmarek:fix/helium-complex-multiply-saturation-47
Open

Prevent Helium complex multiplication saturation#340
sylvesterkaczmarek wants to merge 1 commit into
ARM-software:mainfrom
sylvesterkaczmarek:fix/helium-complex-multiply-saturation-47

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Summary

  • shift both Q15 and Q31 Helium input vectors right by one bit before the saturating complex multiply instructions
  • remove the two-bit result shifts so the stored values retain the documented 3.13 and 3.29 output formats
  • apply the change consistently to pipelined blocks and predicated tails
  • add full-scale positive and negative saturation patterns covering 17 complex samples for both formats

Context

The Helium implementations combined vqdmlsdhq and vqdmladhxq on full-scale inputs. A real or imaginary component above the 1.15 or 1.31 intermediate range could therefore saturate before the final two-bit downshift, even though the documented 3.13 and 3.29 outputs can represent the result.

Scaling each input by one bit keeps the saturating intermediate in range. Removing the result downshift preserves the existing output scale.

Fixes #47

Validation

  • git diff --check
  • python -m py_compile Testing/PatternGeneration/ComplexMaths.py
  • regenerated the new Q15 and Q31 patterns and confirmed the tracked files match generator output
  • successfully preprocessed Testing/desc.txt and generated the full embedded test description
  • compiled the scalar Q15 and Q31 sources with GCC 13.3.0 using -Wall -Wextra -Werror
  • compiled the actual Helium code paths with a host-side MVE intrinsic emulation and compared sample counts 1 through 40 against the scalar implementations; every result was within 2 LSBs
  • checked 1,000,000 random complex products per format; the scaled inputs produced no saturating intermediates and stayed within 2 LSBs of the scalar result
  • confirmed the previous implementation fails all 17 new saturation cases for both Q15 and Q31, while the updated implementation stays within 2 LSBs

Not run

Testing/cmsis_build/runall.py was not run because this environment does not provide the CMSIS Build tools or an Arm Virtual Hardware target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fixed-Point Helium Complex Multiplication saturation sensitivy

1 participant